[Unit]
Description=etcd server
After=network.target
After=network-online.target
Wants=network-online.target

[Service]
Type=notify
WorkingDirectory=/var/lib/etcd/
EnvironmentFile=-/etc/etcd/etcd.conf
ExecStart=/usr/local/bin/etcd --name {{ ansible_hostname }} --initial-advertise-peer-urls http://{{ ansible_ens33.ipv4.address }}:2380 --listen-peer-urls http://{{ ansible_ens33.ipv4.address }}:2380 --listen-client-urls http://{{ ansible_ens33.ipv4.address }}:2379,http://127.0.0.1:2379 --advertise-client-urls http://{{ ansible_ens33.ipv4.address }}:2379 --initial-cluster-token etcd-cluster-1 --initial-cluster master=http://192.168.162.131:2380,node1=http://192.168.162.132:2380,node2=http://192.168.162.133:2380 --initial-cluster-state new --data-dir=/var/lib/etcd

Restart=on-failure
RestartSec=5
LimitNOFILE=65536

[Install]
WantedBy=multi-user.target